package com.cqjtu.drive.response;

import lombok.Getter;
import lombok.Setter;
import org.springframework.stereotype.Service;

/**
 * @Author zxl
 * @Date 2024/6/12 15:50
 */

@Getter
@Setter
public class Response<T> {
    private boolean success;    //成功与否
    private String message;     //提示信息
    private T data;             //返回数据

    // 构造函数
    public Response() {}

    public Response(boolean success, String message) {
        this.success = success;
        this.message = message;
    }

    public Response(boolean success, String message, T data) {
        this.success = success;
        this.message = message;
        this.data = data;
    }

    @Override
    public String toString() {
        return "ResponseMessage{" +
                "success=" + success +
                ", message='" + message + '\'' +
                ", data=" + data +
                '}';
    }
}
